import type { FilterItem } from '@/components/FilterBar/types'
import { getUserInfo } from '@/api/eqpt/houseManger'

import { ref } from 'vue'

export const mapOptions: FilterItem[] = [
  {
    label: '单位名称',
    prop: 'unitName',
    type: 'input',
    span: 7,
    inputProps: {
      clearable: true,
      placeholder: '精确搜索'
    }
  },
  {
    label: '驻场房间编号',
    prop: 'roomNumber',
    type: 'input',
    span: 7,
    inputProps: {
      clearable: true,
      placeholder: '精确搜索'
    }
  },
  {
    label: "录入时间:",
    prop: "creatTime",
    type: "datePicker",
    span: 7,
    defaultValue: [],
    inputProps: {
      type: "datetimerange",
      format: "YYYY-MM-DD HH:mm:ss",
      "start-placeholder": "开始时间",
      "end-placeholder": "结束时间",
      "range-separator": "至",
      "value-format": "YYYY-MM-DD HH:mm:ss",
    },
  },
  {
    label: '单位编号',
    prop: 'unitNumber',
    type: 'input',
    span: 7,
    inputProps: {
      clearable: true,
      placeholder: '精确搜索'
    }
  },
  {
    label: '负责人姓名',
    prop: 'principalName',
    type: 'input',
    span: 7,
    inputProps: {
      clearable: true,
      placeholder: '模糊搜索'
    }
  },
  {
    label: '单位类型',
    prop: 'catalogue',
    filterable: true,
    type: 'treeSelect',
    span: 7,
    defaultValue: null,
    inputProps: {
      'default-expand-all': false,
      'check-strictly': true,
      data: []
    }
  },

]
export const dialogOptions = ref<Array<FilterItem>>([
  {
    label: '名称：',
    prop: 'houseName',
    type: 'input',
    width: "120px",
    span: 12,
    inputProps: {
      clearable: true,
      placeholder: ''
    }
  },
  {
    label: '类别: ',
    prop: 'houseType',
    type: 'select',
    width: "120px",
    filterable: true,
    span: 12,
    inputProps: {
      options: [{
        label: '',
        value: ''
      }]
    }
  },
  {
    label: '编号：',
    prop: 'houseCode',
    type: 'input',
    width: "120px",
    span: 12,
    inputProps: {
      clearable: true,
      placeholder: ''
    }
  },
  {
    label: '数量：',
    prop: 'num',
    type: 'inputNumber',
    width: "120px",
    span: 12,
    defaultValue: 1,
    inputProps: {
      clearable: true,
      min: 1,
      max: 1000,
      placeholder: ''
    }
  },
  {
    label: '面积：',
    prop: 'area',
    type: 'inputBtn',
    width: "120px",
    multiple: true,
    span: 12,
    inputProps: {
      clearable: true,
      unit: '㎡',
      placeholder: ''
    }
  },

  {
    label: '联系人：',
    prop: 'linkUser',
    type: 'select',
    width: "120px",
    filterable: true,
    span: 12,
    /*        isDisabled: true, */
    inputProps: {
      options: []
    }
  },

  {
    label: '联系电话：',
    prop: 'linkPhone',
    type: 'input',
    width: "120px",
    span: 12,
    /*        isDisabled: true, */
    inputProps: {
      clearable: true,
      placeholder: ''
    }
  },

  {
    label: '楼层：',
    prop: 'floor',
    type: 'inputNumber',
    width: "120px",
    span: 12,
    inputProps: {
      clearable: true,
      min: 1,
      max: 100,
      placeholder: '请输入'

    }
  },

  {
    label: '状态：',
    prop: 'state',
    type: 'select',
    width: "120px",
    filterable: true,
    span: 12,
    /*        isDisabled: true, */
    inputProps: {
      options: [
        { label: '使用中', value: '1' },
        { label: '已废弃', value: '2' }
      ]
    }
  }

])

export const mapListFilters: FilterItem[] = [
  {
    label: '在维保期限前：',
    prop: 'time',
    type: 'inputNumber',
    span: 16,
    isDisabled: false,
    inputProps: {
      clearable: true,
      min: 1,
      placeholder: ''
    }

  },
  {
    label: '',
    prop: 'unit',
    type: 'select',
    span: 8,
    isDisabled: false,
    inputProps: {
      options: [
        { label: '年', value: 'Y' },
        { label: '月', value: 'M' },
        { label: '季度', value: 'Q' },
        { label: '周', value: 'W' },
        { label: '日', value: 'D' }
      ]
    }
  }]
